/*
 * Copyright (C) 2018 The Asiainfo-Ability Authors
 *
 *      Licensed under the Apache License, Version 2.0 (the "License");
 *      you may not use this file except in compliance with the License.
 *      You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *      Unless required by applicable law or agreed to in writing, software
 *      distributed under the License is distributed on an "AS IS" BASIS,
 *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *      See the License for the specific language governing permissions and
 *      limitations under the License.
 */

package org.asiainfo.ability.gateway.model;


import org.asiainfo.ability.gateway.code.OnOffState;

import java.util.Date;

/**
 * @Author: visen
 * @Date: 2018/1/16
 * @Description:
 */
public class Ability {


    /**
     */
    private String id;
    private String description;
    private String name;
    private String serviceName;
    private int serviceType;
    private String method;
    //能力限流 针对所有接入进行统计 -1不校验）
    private int rateLimit;
    //能力限流 针对每一个接入单独统计 （-1不校验）
    private int perRateLimit;
    //超时时间
    private int timeout;
    //超时阀值 一分钟内 超时xx次后，系统对该能力自动降级 （-1不校验）
    private int maxTimeoutTimes;
    //超时阀值 针对每个调用者的默认配置
    private int perMaxTimeoutTimes;
    private Date updateDate;
    private OnOffState state = OnOffState.off;

    private boolean isPrivate;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public int getRateLimit() {
        return rateLimit;
    }

    public void setRateLimit(int rateLimit) {
        this.rateLimit = rateLimit;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public int getServiceType() {
        return serviceType;
    }

    public void setServiceType(int serviceType) {
        this.serviceType = serviceType;
    }


    public OnOffState getState() {
        return state;
    }

    public void setState(OnOffState state) {
        this.state = state;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }


    public int getPerRateLimit() {
        return perRateLimit;
    }

    public void setPerRateLimit(int perRateLimit) {
        this.perRateLimit = perRateLimit;
    }

    public int getMaxTimeoutTimes() {
        return maxTimeoutTimes;
    }

    public void setMaxTimeoutTimes(int maxTimeoutTimes) {
        this.maxTimeoutTimes = maxTimeoutTimes;
    }

    public int getPerMaxTimeoutTimes() {
        return perMaxTimeoutTimes;
    }

    public void setPerMaxTimeoutTimes(int perMaxTimeoutTimes) {
        this.perMaxTimeoutTimes = perMaxTimeoutTimes;
    }

    public boolean getIsPrivate() {
        return isPrivate;
    }

    public void setIsPrivate(boolean isPrivate) {
        this.isPrivate = isPrivate;
    }
}
